package com.hmall.user.config;


import com.hmall.user.interceptor.MyHandlerInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * springmvc配置类
 */
@Configuration
public class SpringmvcConfig extends WebMvcConfigurationSupport {

    @Autowired
    private  MyHandlerInterceptor interceptor;

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        //添加springmvc的拦截器

        registry.addInterceptor(interceptor).addPathPatterns("/**");

    }
}